{extend name="public/member/cart_base"/}
{block name="title"}<?=$config_base['title']?>-用户中心-首页{/block}

{block name="style"}

{/block}


		{block name="main"}
		
		<div id="ms-center" class="personal-member child-Cart-1">
			<div class="cont">
			<!--购物车-->
			<div class="news-Coupon-6 clearfix">

			<i>已选商品(不含运费)</i>
			</div>
				<form id="pt_form" action="<?=url('index/cart/cart2')?>" method="post">
			<section class="cartMain">
		        <div class="cartMain_hd">
		            <ul class="order_lists cartTop">
		                <li class="list_chk">
		                    <!--所有商品全选-->
		                    <input type="checkbox" id="all" class="whole_check">
		                    <label for="all"></label>
		                    全选
		                </li>
		                <li class="list_con">商品信息</li>
		                <li class="list_info">商品参数</li>
		                <li class="list_price">单价</li>
		                <li class="list_amount">数量</li>
		                <li class="list_sum">金额</li>
		                <li class="list_op">操作</li>
		            </ul>
		        </div>

				<?php if(!empty($cartList)){foreach($cartList as $k=>$v){?>
		        <div class="cartBox">
		            <div class="shop_info">
		                <div class="all_check">
		                    <!--店铺全选-->
		                    <input type="checkbox" id="shop_<?=$k?>" name="shop_id[]" value="<?=$k?>" class="shopChoice">
		                    <label for="shop_<?=$k?>" class="shop"></label>
		                </div>
		                <div class="shop_name">
		                    店铺：<a href="javascript:;"><?=$v['shop_name']?></a> &nbsp;&nbsp;&nbsp;<a href="<?=url('index/shop/shop_goods_list',['shop_id'=>$v['shop_id']])?>">本店继续购</a>
		                </div>
		            </div>
		            <div class="order_content">
						<?php if(!empty($v['goodsList'])){foreach($v['goodsList'] as $k2=>$v2){?>
		                <ul class="order_lists">
		                    <li class="list_chk">
		                        <input type="checkbox" id="checkbox_<?=$k2?>" name="cart_id[]" value="<?=$v2['cart_id']?>" class="son_check">
		                        <label for="checkbox_<?=$k2?>"></label>
		                    </li>
		                    <li class="list_con">
		                        <div class="list_img"><a href="javascript:;"><img src="/<?=$v2['original_img']?>" alt=""></a></div>
		                        <div class="list_text"><a href="javascript:;"><?=$v2['goods_name']?></a></div>
		                    </li>
		                    <li class="list_info">
								<?php if($v2['spec_key_name'] ==''){?>
		                        <p>规格：默认</p>
								<?php }else{?>
		                        <p><?=$v2['spec_key_name']?></p>
								<?php } ?>
		                    </li>
		                    <li class="list_price">
		                        <p class="price">￥<?=$v2['goods_price']?></p>
		                    </li>
		                    <li class="list_amount">
		                        <div class="amount_box">
		                            <a href="javascript:;" class="reduce reSty" data-cart_id="<?=$v2['cart_id']?>">-</a>
		                            <input type="text" value="<?=$v2['goods_num']?>" class="sum">
		                            <a href="javascript:;" class="plus" data-cart_id="<?=$v2['cart_id']?>">+</a>
		                        </div>
		                    </li>
		                    <li class="list_sum">
		                        <p class="sum_price">￥<?=$v2['goods_price']?></p>
		                    </li>
		                    <li class="list_op">
		                        <p class="del"><a href="javascript:;" class="delBtn" data-cart_id="<?=$v2['cart_id']?>">移除商品</a></p>
		                    </li>
		                </ul>
						<?php }} ?>
		            </div>
		       		<!--本店推荐产品-->

		       		<!--本店推荐产品结束-->
		        </div>
				<?php }}?>

		        <!--底部-->
		        <div class="bar-wrapper">
		            <div class="bar-right">
		                <div class="piece">已选商品<strong class="piece_num">0</strong>件</div>
		                <div class="totalMoney">共计: <strong class="total_text">0.00</strong></div>
		                <div class="calBtn"><a href="javascript:void(0)" onclick="submitOrders(this)">结算</a></div>
		            </div>
		        </div>
		    </section>
				</form>
		    <section class="model_bg"></section>
		    <section class="my_model">
		        <p class="title">删除宝贝<span class="closeModel">X</span></p>
		        <p>您确认要删除该宝贝吗？</p>
		        <div class="opBtn"><a href="javascript:;" class="dialog-sure">确定</a><a href="javascript:;" class="dialog-close">关闭</a></div>
		    </section>

    		<script src="__STATIC__/index/js/carts.js"></script>
    		<script type="text/javascript" src="__STATIC__/index/js/jquery.cssforms.js"></script>
			<script type="text/javascript">
				$(function(){	
					$('.beautify_input').cssSelect();
				});
			</script>
			
			<!--购物车结束-->
			</div>

		</div>

		{/block}




	{block name="js"}
	<script>
		function submitOrders(obj){
			let cart_id = $('input[name="cart_id[]"]:checked').length;
			if($('input[name="shop_id[]"]:checked').length >1){
				layer.msg('只能结算一个同一个商家的商品');
				return false;
			}
			if($(obj).hasClass('btn_sty')){
				if($('input[name="cart_id[]"]:checked').length<1){
					layer.msg('至少选择一种商品结算');
					return false;
				}
				$('#pt_form').submit();
			}
		}

		$('input[name="cart_id[]"]').prop('checked',false);
		//window.location.reload();
	</script>
	{/block}


